package co.yixiang.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
* @author zf
* @date 2021-09-24
*/
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("user_roll")
public class UserRoll implements Serializable {

    @TableId
    private Integer id;


    /** 业务员 */
    @NotBlank
    private String openId;


    /** 业务员名称 */
    private String salesman;


    /** 用户名称 */
    private String name;


    /** 手机号 */
    private String phone;


    /** 备注 */
    private String remark;


    /** 贷款金额 */
    private BigDecimal loan;


    /** 卷状态 */
    private Integer loanStatus;


    /** 消费卷状态 */
    private Integer speedStatus;


    /** 创建时间 */
    @TableField(fill= FieldFill.INSERT)
    private LocalDateTime createTime;


    public void copy(UserRoll source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
